#include <iostream>
#include <string>
#include <memory>

#include "tcp_client.hpp"

#include <errno.h>
#include <string.h>


#include "log.hpp"

using namespace my_tcpc;

static void usage(const char* port)
{
    std::cout<<"USAGE:\n\t"<<port<<" serverip serverport\n"<<std::endl;
}

int main(int argc,char* argv[])
{
    if(argc != 3)
    {
        usage(argv[0]);
        exit(USAGE_ERR);
    }
    const std::string ip = argv[1];
    const uint16_t port = atoi(argv[2]);
    //std::cout<<ip<<std::endl;
    //std::cout<<port<<std::endl;
    
    std::unique_ptr<Client> cle(new Client(ip,port));
    cle->InitClient();
    cle->Start();

    return 0;
}